package com.stars.empoly.adapter

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.qmuiteam.qmui.kotlin.onClick
import com.stars.empoly.R
import com.stars.empoly.activity.TechDetailsActivity
import com.stars.empoly.activity.TechListActivity
import com.stars.empoly.databinding.ItemHomeClientBinding
import com.stars.empoly.databinding.ItemHomeFristBinding
import com.stars.empoly.model.DriverProfit
import com.stars.empoly.model.MsgList
import com.stars.empoly.model.ServiceList
import com.stars.empoly.vmodel.HomeClientVModel
import com.stars.empoly.vmodel.HomeFirstVModel
import com.trailer.base.base.BAdapter
import com.trailer.base.utils.B
import com.trailer.base.utils.UiSwitch

class HomeClientAdapter(var vm: HomeClientVModel) : BAdapter<ServiceList.ContentBean, BaseDataBindingHolder<ItemHomeClientBinding>>(R.layout.item_home_client) {
    override fun convert(holder: BaseDataBindingHolder<ItemHomeClientBinding>, item: ServiceList.ContentBean) {
        holder.dataBinding?.item = item
        holder.dataBinding?.vm=vm

        holder.dataBinding?.ll?.onClick {
            //进详情

            UiSwitch.bundle(context(), TechDetailsActivity::class.java, B().putString("id",item.id).ok())
        }
        holder.dataBinding?.llCenter?.onClick {
            UiSwitch.bundle(context(), TechListActivity::class.java, B().putString("id",item.id).ok())

        }


    }
}
